﻿@using StripeOne.Blog.Base.Common
@model StripeOne.Blog.Models.PostModel
@{
    ViewBag.Title = AdminTranslation.Current.GetText("Posts", "NewPostTitle");
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    var commentsDisabled = Model.CommentsDisabled.ToString().ToLower();
}
<div class="row-fluid">
    <div class="span12">
        <h1>
            @AdminTranslation.Current.GetText("Posts", "NewPostTitle")</h1>
    </div>
</div>
<div class="row-fluid">
    <form action="@Url.RouteUrl("PostsAdd_BLA")" id="formPost" method="post">
    <div class="span9">
        <fieldset class="well form-inline">
            <div class="control-group">
                <div class="controls">
                    <input type="text" style="width: 98%" name="postTitle" value="@Model.Title" placeholder="@AdminTranslation.Current.GetText("Posts", "InsertTitle")" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <textarea class="textarea" name="post" id="post" rows="20" style="width: 98%;">@Model.Post</textarea>
                </div>
            </div>
        </fieldset>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" rel="tooltip" data-toggle="collapse" href="#digestDiv">
                    @AdminTranslation.Current.GetText("Posts", "Digest")<i id="digestHelp" rel="tooltip" class="icon-info-sign" title="@AdminTranslation.Current.GetText("Posts", "DigestHelp")" style="margin-left:10px;">
                    </i></a>
            </div>
            <div id="digestDiv" class="accordion-body collapse in">
                <div class="accordion-inner">
                    <textarea class="textarea" name="digest" id="digest" rows="7" style="width: 98%;">@Model.Digest</textarea>
                    <div id="characterCounter" class="characterCounter pull-right"></div> 
                </div>
            </div>
        </div>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle" rel="tooltip" data-toggle="collapse" href="#discusDiv">
                    @AdminTranslation.Current.GetText("Common", "Comments")</a>
            </div>
            <div id="discusDiv" class="accordion-body collapse in">
                <div class="accordion-inner">
                    <label class="checkbox">
                        <input type="checkbox" id="chkCommentsDisabled" name="chkCommentsDisabled" @(Model.CommentsDisabled ? "checked=checked" : "") value="@commentsDisabled" />
                        @AdminTranslation.Current.GetText("Common", "DisableComments")
                    </label>
                    @*TODO: Adicionar verificação se tem comentarios e link quando existir area de edição de comentarios*@
                    X @AdminTranslation.Current.GetText("Common", "Comments") (<a href="#">@AdminTranslation.Current.GetText("Common", "EditComments")</a>)
                </div>
            </div>
        </div>
    </div>
    <div class="span3">
        @Html.Partial("_PostRightMenu", Model)
    </div>
    </form>
</div>
@section EndBodyScripts{
    <script type="text/javascript">
        Admin.Posts.Init();
    </script>
}
